﻿<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head lang="en" th:replace="main/public :: #public_head">

</head>
<body>
<!--头部-->
<header class="publicHeader" th:replace="main/public :: #public_header">

</header>
<!--时间-->
<section class="publicTime" th:replace="main/public :: #public_time">

</section>
<!--主体内容-->
<section class="publicMian ">
    <div class="left" th:replace="main/public :: #public_left(activeUri='user')">
    </div>
    <div class="right">
        <div class="location">
            <strong>你现在所在的位置是:</strong>
            <span>用户管理页面 >> 用户修改页面</span>
        </div>
        <div class="providerAdd">
            <form id="updateForm" action="#" th:action="@{/user}" th:method="post">
                <!--发送put请求修改信息-->

                <!--1. 在SpringMVC中配置HiddenHttpMethodFilter（SpringBoot自动配置好了）-->
                <!--2. 页面创建一个method="post"表单-->
                <!--3. 创建一个input标签 name="_method"，value="指定请求方式"-->
                <input th:type="hidden" name="_method" value="put">
                <input th:type="hidden" name="id" th:value="${user.id}">
                <input th:type="hidden" name="username" th:value="${user.username}">
                <input th:type="hidden" name="password" th:value="${user.password}">

                <!--div的class 为error是验证错误，ok是验证成功-->
                <div>
                    <label for="realName">真实姓名：</label>
                    <input type="text" th:value="${user.realName}" name="realName" id="realName" placeholder="韩露"/>
                    <span >*</span>
                </div>

                <div>
                    <label >用户性别：</label>

                    <select name="gender">
                        <option value="1" th:selected="${user.gender == 1}">女</option>
                        <option value="2" th:selected="${user.gender == 2}" selected>男</option>
                    </select>
                </div>
                <div>
                    <label for="birthday">出生日期：</label>
                    <input type="text" th:value="${#dates.format(user.birthday, 'yyyy-MM-dd')}" name="birthday" id="birthday" placeholder="2016年2月1日"/>
                    <span >*</span>
                </div>
                <div>
                    <label >用户类别：</label>
                    <!--1管理员  2经理  3普通用户-->
                    <input type="radio" name="userType" value="1" th:checked="${user.userType == 1}"/>管理员
                    <input type="radio" name="userType" value="2" th:checked="${user.userType == 2}" checked/>经理
                    <input type="radio" name="userType" value="3" th:checked="${user.userType == 3}"/>普通用户
                </div>
                <div class="providerAddBtn">
                    <!--<a href="#">保存</a>-->
                    <!--<a href="userList.html">返回</a>-->
                    <input type="button" value="保存" onclick="$('#updateForm').submit()"/>
                    <input type="button" value="返回" onclick="history.back(-1)"/>
                </div>
            </form>
        </div>

    </div>
</section>
<footer class="footer" th:replace="main/public :: #public_footer">
</footer>
<script th:src="@{/webjars/jquery/3.3.1/jquery.js}" src="../js/jquery.js"></script>
<!--
	<script src="js/time.js"></script>
	-->
</body>
</html>